home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / pjp / osistrin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-02  |  388 b   |  20 lines

  1. ------------- Listing 7: The file osistrin.c -------------
  2.  
  3. // osistring -- ostream::operator<<(const char *) 
  4. #include <string.h> 
  5. #include <ostream> 
  6.  
  7. ostream& ostream::operator<<(const char *x) 
  8.     {    // insert a string 
  9.     _TRY_IO_BEGIN 
  10.     if (!opfx()) 
  11.         setstate(badbit); 
  12.     else 
  13.         _Pad("   s", (char *)x, strlen(x)); 
  14.     osfx(); 
  15.     _CATCH_IO_END 
  16.     return (*this); 
  17.     }
  18.  
  19.  
  20.